package com.eastjet.equipment.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.eastjet.equipment.service.DevicePostService;
import com.eastjet.maintenance.domain.DevicePost;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/post")
public class PostController {

    @Autowired
    private DevicePostService devicePostService;

    @RequestMapping("/list")
    public Page<DevicePost> getDevicePostList(
            @RequestParam(defaultValue = "1") int page,
            @RequestParam(defaultValue = "2") int size,
            @RequestParam(defaultValue ="") String condition
    ) {

        System.out.println("condition:" + condition);
        return devicePostService.getDevicePost(page, size, condition);
    }
}
